
package test;
import java.sql.*;
/**
 *
 * @author Seralan
 */
public class persona {
Conectate con;

public persona(){
    con =new Conectate();
    
 
}

/*añade un nuevo registro*/

public void NuevaPersona(String name, String AP, String AM, String mail){
  try {
      PreparedStatement pstm = con.getConnection().prepareStatement("insert into " + 
                    "persona(Nombre, appPaterno, appMaterno, mail) " +
                    " values(?,?,?,?)");            
            pstm.setString(1, name);
            pstm.setString(2, AP);
            pstm.setString(3, AM);                        
            pstm.setString(4, mail);                        
            pstm.execute();
            pstm.close();            
         }
  catch(SQLException e){
         System.out.println(e);
         }
  
}
}
